package COMP;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;

import javax.swing.JPanel;


class DrawString extends JPanel{
	String name;
	int xInit;
	int yInit;
	int fontSize = 15;
	double theta = 0;
	Color color = new Color(100, 100, 100);

	DrawString(String name, int xInit, int yInit){
		this.name = name;
		this.xInit = xInit;
		this.yInit = yInit;
		this.setSize(550,400);
		this.setOpaque(false);
	}
	DrawString(String name, int xInit, int yInit,Color color){
		this(name,xInit,yInit);
		this.color = color;
	}
	DrawString(String name, int xInit, int yInit,double theta){
		this(name,xInit,yInit);
		this.theta = theta;
	}
	public void paint(Graphics g){
		Graphics2D g2d = (Graphics2D)g.create();
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setColor(color);
		g2d.rotate(theta,xInit,yInit);
		g2d.setFont(new Font("Gulim", Font.PLAIN, fontSize));
		g2d.drawString(name, xInit, yInit);	

	}
	public void setFontSize(int fontSize){
		this.fontSize = fontSize;
	}
}